package svc

import (
	"github.com/tal-tech/go-zero/zrpc"
	"go-zero-mult/service/api/internal/config"
	"go-zero-mult/service/rpc/good/good"
	"go-zero-mult/service/rpc/merchant/merchant"
)

type ServiceContext struct {
	Config config.Config
	GoodRpc good.Good
	MerchantRpc merchant.Merchant
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,
		GoodRpc: good.NewGood(zrpc.MustNewClient(c.GoodRpc)),
		MerchantRpc: merchant.NewMerchant(zrpc.MustNewClient(c.MerchantRpc)),
	}
}
